<?php
/**
 * @version		$Id: blog_item.php 22283 2011-10-25 07:32:19Z github_bot $
 * @package		Joomla.Site
 * @subpackage	com_content
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

// Create a shortcut for params.
$params = &$this->item->params;
$canEdit	= $this->item->params->get('access-edit');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::core();

?>
			<div class="healthnews fl pt15 bd2B mr30 ofh">
				<div class="w190 taj mb15 fl mr20 shadow1">
					<?php
			//code lay hinh
				$arr2 = preg_split('/<(IMG|img) /', $this->item->introtext);
	
	
				//if(sizeof($arr2) <= 1) return '';
			    
			    
				$arr3 = preg_split('/src=\"/', $arr2[1]);
			    
			    
				//if(sizeof($arr3) <= 1) return '';
			    
				$arr4 = preg_split('/\"/', $arr3[1]);
			    
			    
			    
				if(preg_match('/http:/', $arr4[0]))
				{
				    $result = $arr4[0];
				}
				else if(preg_match('/^\//', $arr4[0])){
				    $result = $u2 . substr($arr4[0],1);
				}
				else
				{
				    for($ei = 3; $ei < sizeof($u1) - 1; $ei++)
				    {
					$u2 .= $u1[$ei] . "/";
				    }
				    $result = $u2 . $arr4[0];
				}
			
			?>
			<img src="<?php if ($result=="") 
																					echo JURI::base()."/templates/jade/images/white.png";
																					else echo $result; ?>" alt="" class="" title="<?php echo $item->title; ?>"  width="190" height="125" />
				</div>
				<div class="w750 taj fl">
					<p class="pa0 fs15"><?php echo $this->item->title; ?></p>
					<p class="cf1 pa0 ff4">
					<?php if ($params->get('show_publish_date')) : ?>
						<?php echo JHtml::_('date',$this->item->publish_up, JText::_('DATE_FORMAT_LC4')); ?>
					<?php endif; ?>
					</p>
					<p class="pa0 pb15">
						<?php 
				
										$arr = explode(" ", strip_tags($this->item->introtext));
										if(count($arr) >= 40)
										{
											$this->item->sintrotext = "";
											for($i=0; $i < 40; $i++)
											{
												$this->item->sintrotext .= $arr[$i]." ";
											}
											$this->item->sintrotext .= "...";
										}
										else $this->item->sintrotext = strip_tags($this->item->introtext);
										$this->item->sintrotext = str_replace("\"", "", $this->item->sintrotext);
										
										echo $this->item->sintrotext;
						?>
					</p>
					<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>" class="button">read more</a>
				
				</div>
			</div>
<?php echo $this->item->event->afterDisplayContent; ?>
